package org.tech4j.edi.persistence.jdbc.util;

import org.springframework.jdbc.core.RowMapper;

import java.util.List;
import java.util.Map;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/8 10:42
 **/
public interface JdbcListFactory {

    /**
     * @param sql
     * @param parameters
     * @return a list of {@link T}
     */
    <T> List<T> getList(String sql, Map<String, Object> parameters, RowMapper<T> rowMapper);

    /**
     * 统计
     * @param sql
     * @param parameters
     * @return
     */
    Long count(String sql, Map<String, Object> parameters);
}
